package situ.autoweter.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.springframework.stereotype.Controller;
import situ.autoweter.service.IvOutinvoiceService;
import situ.autoweter.entity.IvOutinvoice;
import java.util.*;
/**
 * IvOutinvoice的路由接口服务
 * 
 * @author 胡文
 *
 */
@Controller
public class IvOutinvoiceController {

	/** IvOutinvoiceService服务 */
	@Autowired
	private IvOutinvoiceService ivOutinvoiceService;
	
	/**
	 * 查询所有IvOutinvoice数据的方法
	 * @param value
	 * @return
	 */
	@RequestMapping(value = "queryIvOutinvoice", produces = {"application/json;charset=UTF-8"})
	public String find(IvOutinvoice value,Map map) {
		 List<IvOutinvoice> list= ivOutinvoiceService.find(value);
         map.put("items",list);
         return "页面名称自己改";
	}
	
	/**
	 * 通过id查询IvOutinvoice数据的方法
	 * 
	 * @return
	 */
	@RequestMapping(value = "queryIvOutinvoiceById/{id}", produces = {"application/json;charset=UTF-8"})
	public String findOne(@PathVariable(name="id") Object id,Map map) {
        IvOutinvoice obj=  ivOutinvoiceService.findOne(id);
        map.put("IvOutinvoice",obj);
        return "页面名称自己改";
	}
	
	/**
	 * 插入IvOutinvoice属性不为空的数据方法
	 * 
	 * @return
	 */
	@RequestMapping(value = "saveIvOutinvoice", produces = {"application/json;charset=UTF-8"})
	public String save(IvOutinvoice value) {
		  ivOutinvoiceService.saveNotNull(value);
        return "redirect:/queryIvOutinvoice";
	}
	
	/**
	 * 更新IvOutinvoice属性不为空的数据方法
	 * 
	 * @return
	 */
	@RequestMapping(value = "updateIvOutinvoice", produces = {"application/json;charset=UTF-8"})
	public String update(IvOutinvoice value) {
		  ivOutinvoiceService.updateNotNullById(value);
          return "redirect:/queryIvOutinvoice";
	}
	
	/**
	 * 通过id删除IvOutinvoice数据方法
	 * 
	 * @return
	 */
	@RequestMapping(value = "delIvOutinvoiceById/{id}", produces = {"application/json;charset=UTF-8"})
	public String delete(@PathVariable(name="id") Object id) {
		  ivOutinvoiceService.deleteById(id);
          return "redirect:/queryIvOutinvoice";
	}
}
